<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"emoh.xyz","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="1.修改数据库参数utl_file_dir,不能动态修改，需要重启数据库1alter system set utl_file_dir&#x3D;&#39;&#x2F;u01&#x2F;arch&#39; scope&#x3D;spfile  2.重启数据库1shutdown immediate; 3.启动数据库1startup  4.检查数据库参数是否修改成功1show parameter utl_file_dir     5.创建数据字典123EXE">
<meta property="og:type" content="article">
<meta property="og:title" content="ORACLE 日志挖掘分析(Logmnr)">
<meta property="og:url" content="http://emoh.xyz/2020/05/27/2019-07-18-ORACLE%20%E6%97%A5%E5%BF%97%E6%8C%96%E6%8E%98%E5%88%86%E6%9E%90(Logmnr)/index.html">
<meta property="og:site_name" content="Just do it!">
<meta property="og:description" content="1.修改数据库参数utl_file_dir,不能动态修改，需要重启数据库1alter system set utl_file_dir&#x3D;&#39;&#x2F;u01&#x2F;arch&#39; scope&#x3D;spfile  2.重启数据库1shutdown immediate; 3.启动数据库1startup  4.检查数据库参数是否修改成功1show parameter utl_file_dir     5.创建数据字典123EXE">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-05-27T02:14:16.042Z">
<meta property="article:modified_time" content="2020-05-28T03:33:52.152Z">
<meta property="article:author" content="Emoh">
<meta property="article:tag" content="logmnr">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://emoh.xyz/2020/05/27/2019-07-18-ORACLE%20%E6%97%A5%E5%BF%97%E6%8C%96%E6%8E%98%E5%88%86%E6%9E%90(Logmnr)/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>ORACLE 日志挖掘分析(Logmnr) | Just do it!</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Just do it!</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://emoh.xyz/2020/05/27/2019-07-18-ORACLE%20%E6%97%A5%E5%BF%97%E6%8C%96%E6%8E%98%E5%88%86%E6%9E%90(Logmnr)/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/touxiang.png">
      <meta itemprop="name" content="Emoh">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Just do it!">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          ORACLE 日志挖掘分析(Logmnr)
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-05-27 10:14:16" itemprop="dateCreated datePublished" datetime="2020-05-27T10:14:16+08:00">2020-05-27</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-05-28 11:33:52" itemprop="dateModified" datetime="2020-05-28T11:33:52+08:00">2020-05-28</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/oracle-%E5%A4%87%E4%BB%BD%E6%81%A2%E5%A4%8D/" itemprop="url" rel="index"><span itemprop="name">oracle 备份恢复</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="1-修改数据库参数utl-file-dir-不能动态修改，需要重启数据库"><a href="#1-修改数据库参数utl-file-dir-不能动态修改，需要重启数据库" class="headerlink" title="1.修改数据库参数utl_file_dir,不能动态修改，需要重启数据库"></a>1.修改数据库参数utl_file_dir,不能动态修改，需要重启数据库</h2><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">alter</span> <span class="keyword">system</span> <span class="keyword">set</span> utl_file_dir=<span class="string">'/u01/arch'</span> <span class="keyword">scope</span>=<span class="keyword">spfile</span></span><br></pre></td></tr></table></figure>

<h2 id="2-重启数据库"><a href="#2-重启数据库" class="headerlink" title="2.重启数据库"></a>2.重启数据库</h2><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">shutdown immediate;</span><br></pre></td></tr></table></figure>
<h2 id="3-启动数据库"><a href="#3-启动数据库" class="headerlink" title="3.启动数据库"></a>3.启动数据库</h2><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">startup</span><br></pre></td></tr></table></figure>

<h2 id="4-检查数据库参数是否修改成功"><a href="#4-检查数据库参数是否修改成功" class="headerlink" title="4.检查数据库参数是否修改成功"></a>4.检查数据库参数是否修改成功</h2><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">show</span> parameter utl_file_dir</span><br></pre></td></tr></table></figure>




<h2 id="5-创建数据字典"><a href="#5-创建数据字典" class="headerlink" title="5.创建数据字典"></a>5.创建数据字典</h2><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">EXECUTE</span> DBMS_LOGMNR_D.BUILD(<span class="string">'dictionary.ora'</span>, - </span><br><span class="line">  <span class="string">'/oracle/database/'</span>, - </span><br><span class="line">   DBMS_LOGMNR_D.STORE_IN_FLAT_FILE);</span><br></pre></td></tr></table></figure>

<ul>
<li>也可以这样创建数据字典 </li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">begin</span> </span><br><span class="line">sys.dbms_logmnr_d.build(dictionary_filename=&gt;<span class="string">'dictionary.ora'</span>,dictionary_location=&gt;<span class="string">'/u01/arch'</span>);     </span><br><span class="line"><span class="keyword">end</span>;</span><br></pre></td></tr></table></figure>

<ul>
<li>数据字典选项 </li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">Using the Online Catalog </span><br><span class="line">  Oracle recommends that you <span class="keyword">use</span> this <span class="keyword">option</span> <span class="keyword">when</span> you will have <span class="keyword">access</span> <span class="keyword">to</span> the <span class="keyword">source</span> <span class="keyword">database</span> <span class="keyword">from</span> which the <span class="keyword">redo</span> <span class="keyword">log</span> files were created <span class="keyword">and</span> <span class="keyword">when</span> <span class="keyword">no</span> changes <span class="keyword">to</span> the <span class="keyword">column</span> definitions <span class="keyword">in</span> the <span class="keyword">tables</span> <span class="keyword">of</span> interest <span class="keyword">are</span> anticipated. This <span class="keyword">is</span> the most efficient <span class="keyword">and</span> easy-<span class="keyword">to</span>-<span class="keyword">use</span> option. </span><br><span class="line">  Extracting a LogMiner Dictionary <span class="keyword">to</span> the <span class="keyword">Redo</span> <span class="keyword">Log</span> Files </span><br><span class="line">  <span class="keyword">Oracle</span> recommends that you <span class="keyword">use</span> this <span class="keyword">option</span> <span class="keyword">when</span> you <span class="keyword">do</span> <span class="keyword">not</span> expect <span class="keyword">to</span> have <span class="keyword">access</span> <span class="keyword">to</span> the <span class="keyword">source</span> <span class="keyword">database</span> <span class="keyword">from</span> which the <span class="keyword">redo</span> <span class="keyword">log</span> files were created, <span class="keyword">or</span> <span class="keyword">if</span> you anticipate that changes will be made <span class="keyword">to</span> the <span class="keyword">column</span> definitions <span class="keyword">in</span> the <span class="keyword">tables</span> <span class="keyword">of</span> interest. </span><br><span class="line">  Extracting the LogMiner Dictionary <span class="keyword">to</span> a Flat <span class="keyword">File</span> </span><br><span class="line">  This <span class="keyword">option</span> <span class="keyword">is</span> maintained <span class="keyword">for</span> backward <span class="keyword">compatibility</span> <span class="keyword">with</span> previous releases. This <span class="keyword">option</span> does <span class="keyword">not</span> <span class="keyword">guarantee</span> <span class="keyword">transactional</span> consistency. <span class="keyword">Oracle</span> recommends that you <span class="keyword">use</span> either the <span class="keyword">online</span> <span class="keyword">catalog</span> <span class="keyword">or</span> <span class="keyword">extract</span> the dictionary <span class="keyword">from</span> <span class="keyword">redo</span> <span class="keyword">log</span> files instead.</span><br></pre></td></tr></table></figure>

<h2 id="6-添加日志文件，指定时间范围数据库自动添加日志文件"><a href="#6-添加日志文件，指定时间范围数据库自动添加日志文件" class="headerlink" title="6.添加日志文件，指定时间范围数据库自动添加日志文件"></a>6.添加日志文件，指定时间范围数据库自动添加日志文件</h2><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">ALTER</span> <span class="keyword">SESSION</span> <span class="keyword">SET</span> NLS_DATE_FORMAT = <span class="string">'DD-MON-YYYY HH24:MI:SS'</span>; </span><br><span class="line"><span class="keyword">EXECUTE</span> DBMS_LOGMNR.START_LOGMNR( - </span><br><span class="line">  STARTTIME =&gt; <span class="string">'01-Jan-2003 08:30:00'</span>, - </span><br><span class="line">  ENDTIME =&gt; <span class="string">'01-Jan-2003 08:45:00'</span>, - </span><br><span class="line">  OPTIONS =&gt; DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + - </span><br><span class="line">  DBMS_LOGMNR.CONTINUOUS_MINE); </span><br><span class="line"><span class="keyword">EXECUTE</span> DBMS_LOGMNR.START_LOGMNR( - </span><br><span class="line">  STARTTIME =&gt; <span class="keyword">to_date</span>(<span class="string">'20130822 00:15:00'</span>,<span class="string">'yyyymmdd hh24:mi:ss'</span>), - </span><br><span class="line">  ENDTIME =&gt; <span class="keyword">to_date</span>(<span class="string">'20130823 00:15:00'</span>,<span class="string">'yyyymmdd hh24:mi:ss'</span>), - </span><br><span class="line">  OPTIONS =&gt; DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + - </span><br><span class="line">  DBMS_LOGMNR.CONTINUOUS_MINE);</span><br></pre></td></tr></table></figure>
<ul>
<li>也可以这样手工添加，添加第一个日志文件 </li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">EXECUTE</span> DBMS_LOGMNR.ADD_LOGFILE( - </span><br><span class="line">  LOGFILENAME =&gt; <span class="string">'/u01/app/oracle/oradata/orcl/redo01.log'</span>, - </span><br><span class="line">  OPTIONS =&gt; DBMS_LOGMNR.NEW);</span><br></pre></td></tr></table></figure>

<ul>
<li>继续添加日志文件，一次只能添加一个 </li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">EXECUTE</span> DBMS_LOGMNR.ADD_LOGFILE( - </span><br><span class="line">  LOGFILENAME =&gt; <span class="string">'/u01/app/oracle/oradata/orcl/redo02.log'</span>, - </span><br><span class="line">  OPTIONS =&gt; DBMS_LOGMNR.ADDFILE);</span><br></pre></td></tr></table></figure>

<h2 id="7-开始分析"><a href="#7-开始分析" class="headerlink" title="7.开始分析"></a>7.开始分析</h2><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">EXECUTE</span> DBMS_LOGMNR.START_LOGMNR( - </span><br><span class="line">  DICTFILENAME =&gt;<span class="string">'/u01/arch/dictionary.ora'</span>);</span><br></pre></td></tr></table></figure>

<ul>
<li>基于时间点分析 </li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">ALTER</span> <span class="keyword">SESSION</span> <span class="keyword">SET</span> NLS_DATE_FORMAT = <span class="string">'DD-MON-YYYY HH24:MI:SS'</span>; </span><br><span class="line"><span class="keyword">EXECUTE</span> DBMS_LOGMNR.START_LOGMNR( - </span><br><span class="line">  DICTFILENAME =&gt; <span class="string">'/oracle/database/dictionary.ora'</span>, - </span><br><span class="line">  STARTTIME =&gt; <span class="string">'01-Jan-1998 08:30:00'</span>, - </span><br><span class="line">  ENDTIME =&gt; <span class="string">'01-Jan-1998 08:45:00'</span>- </span><br><span class="line">  OPTIONS =&gt; DBMS_LOGMNR.CONTINUOUS_MINE);</span><br></pre></td></tr></table></figure>

<ul>
<li>基于SCN分析 </li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">EXECUTE</span> DBMS_LOGMNR.START_LOGMNR(- </span><br><span class="line">   STARTSCN =&gt; <span class="number">621047</span>, - </span><br><span class="line">   ENDSCN   =&gt; <span class="number">625695</span>, - </span><br><span class="line">   OPTIONS  =&gt; DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + - </span><br><span class="line">               DBMS_LOGMNR.CONTINUOUS_MINE);</span><br></pre></td></tr></table></figure>

<ul>
<li>查看分析结果 </li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> OPERATION, SQL_REDO, SQL_UNDO </span><br><span class="line">  <span class="keyword">FROM</span> V$LOGMNR_CONTENTS</span><br></pre></td></tr></table></figure>

<ul>
<li>与logminer相关的数据字典 </li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">1、v$loglist           它用于显示历史日志文件的一些信息 </span><br><span class="line">2、v$logmnr_dictionary 因logmnr可以有多个字典文件，该视图用于显示这方面信息。 </span><br><span class="line">3、v$logmnr_parameters 它用于显示logmnr的参数 </span><br><span class="line">4、v$logmnr_logs       它用于显示用于分析的日志列表信息。</span><br></pre></td></tr></table></figure>




<h3 id="实操"><a href="#实操" class="headerlink" title="实操"></a>实操</h3><ul>
<li>修改数据库参数</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">alter</span> <span class="keyword">system</span> <span class="keyword">set</span> utl_file_dir=<span class="string">'/home/oracle/logmnr/'</span> <span class="keyword">scope</span>=<span class="keyword">spfile</span>;</span><br></pre></td></tr></table></figure>

<ul>
<li>创建数据字典</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">execute</span> dbms_logmnr_d.build(dictionary_filename =&gt; <span class="string">'logminer_dict180615.dat'</span>,dictionary_location =&gt; <span class="string">'/home/oracle'</span>);</span><br></pre></td></tr></table></figure>

<ul>
<li>添加归档日志</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">execute</span> dbms_logmnr.add_logfile(<span class="string">'/oracle/2_55500_800136400.dbf'</span>,DBMS_LOGMNR.new);</span><br><span class="line"><span class="keyword">execute</span> dbms_logmnr.add_logfile(<span class="string">'/oracle/2_55501_800136400.dbf'</span>,DBMS_LOGMNR.addfile);</span><br><span class="line"><span class="keyword">execute</span> dbms_logmnr.add_logfile(<span class="string">'/oracle/2_55502_800136400.dbf'</span>,DBMS_LOGMNR.addfile);</span><br><span class="line"><span class="keyword">execute</span> dbms_logmnr.add_logfile(<span class="string">'/oracle/2_55503_800136400.dbf'</span>,DBMS_LOGMNR.addfile);</span><br><span class="line"><span class="keyword">execute</span> dbms_logmnr.add_logfile(<span class="string">'/oracle/2_55504_800136400.dbf'</span>,DBMS_LOGMNR.addfile);</span><br></pre></td></tr></table></figure>

<ul>
<li>开始日志挖掘</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">execute</span> dbms_logmnr.start_logmnr(dictfilename =&gt; <span class="string">'/oracle/logminer_dict180615.dat'</span>);</span><br></pre></td></tr></table></figure>


<ul>
<li>永久保存挖掘结果</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">create</span> <span class="keyword">table</span> logmnr_contents <span class="keyword">as</span> <span class="keyword">select</span> * <span class="keyword">from</span> v$logmnr_contents;</span><br></pre></td></tr></table></figure>

<ul>
<li>结束日志挖掘</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">execute</span> dbms_logmnr.end_logmnr();</span><br></pre></td></tr></table></figure>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/logmnr/" rel="tag"># logmnr</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/05/27/2019-07-18-ORACLE%20DataGuard%E6%97%A5%E5%B8%B8%E7%9B%91%E6%8E%A7SQL/" rel="prev" title="ORACLE DataGuard日常监控SQL">
      <i class="fa fa-chevron-left"></i> ORACLE DataGuard日常监控SQL
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/05/27/2019-07-18-Zabbix%20%E7%9B%91%E6%8E%A7%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%92%8C%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E6%97%B6%E9%97%B4%E5%B7%AE/" rel="next" title="Zabbix 监控客户端和服务器的时间差">
      Zabbix 监控客户端和服务器的时间差 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-修改数据库参数utl-file-dir-不能动态修改，需要重启数据库"><span class="nav-number">1.</span> <span class="nav-text">1.修改数据库参数utl_file_dir,不能动态修改，需要重启数据库</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-重启数据库"><span class="nav-number">2.</span> <span class="nav-text">2.重启数据库</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-启动数据库"><span class="nav-number">3.</span> <span class="nav-text">3.启动数据库</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-检查数据库参数是否修改成功"><span class="nav-number">4.</span> <span class="nav-text">4.检查数据库参数是否修改成功</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-创建数据字典"><span class="nav-number">5.</span> <span class="nav-text">5.创建数据字典</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-添加日志文件，指定时间范围数据库自动添加日志文件"><span class="nav-number">6.</span> <span class="nav-text">6.添加日志文件，指定时间范围数据库自动添加日志文件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-开始分析"><span class="nav-number">7.</span> <span class="nav-text">7.开始分析</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#实操"><span class="nav-number">7.1.</span> <span class="nav-text">实操</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Emoh"
      src="/images/touxiang.png">
  <p class="site-author-name" itemprop="name">Emoh</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">29</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Emoh</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
